import {getById} from '../services/student'
export default {
    namespaced:true,
    state:{
        visible:false,
        student:{}
    },
    mutations:{
        setVisible(state,visible){
            console.log("visible",visible)
            state.visible = visible;
        },
        setStudent(state,student){
            state.student = {...student};
        }
    },
    actions:{
        async showById({commit},id){
            let student = await getById(id);
            commit('setStudent',student);
        }
    }
}